<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Generating RSS (Really Simple Syndication)</title>
	<link rel="stylesheet" type="text/css" href="../media/style.css">
	<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
	<script src="media/a.js"></script>
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
	<td class="header-top-left"><img src="../media/logo.png" border="0" alt="phpDocumentor " /></td>
    <td class="header-top-right">QueryPath<br /><div class="header-top-right-subpackage"></div></td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td colspan="2" class="header-menu">
      
                        
                                                  		[ <a href="../classtrees_QueryPath.html" class="menu">class tree: QueryPath</a> ]
		[ <a href="../elementindex_QueryPath.html" class="menu">index: QueryPath</a> ]
            [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="195" class="menu">
		<div class="package-title">QueryPath</div>
  <div class="package">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
	</div>
      <b>Packages:</b><br />
  <div class="package">
              <a href="../li_QueryPath.html">QueryPath</a><br />
              <a href="../li_Examples.html">Examples</a><br />
              <a href="../li_Tests.html">Tests</a><br />
      	</div>
      <br />
                        <br />
                      </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Generating RSS (Really Simple Syndication)</h1>
<div class="src-code"><span class="php">
<ol><li><div class="src-line"><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*&nbsp;Using&nbsp;QueryPath&nbsp;to&nbsp;Generate&nbsp;an&nbsp;RSS&nbsp;feed.</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*&nbsp;This&nbsp;file&nbsp;contains&nbsp;an&nbsp;example&nbsp;of&nbsp;how&nbsp;QueryPath&nbsp;can&nbsp;be&nbsp;used</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*&nbsp;to&nbsp;generate&nbsp;an&nbsp;RSS&nbsp;feed.</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*&nbsp;It&nbsp;uses&nbsp;two&nbsp;stubs&nbsp;--&nbsp;one&nbsp;for&nbsp;the&nbsp;main&nbsp;RSS&nbsp;file,&nbsp;and&nbsp;one&nbsp;for&nbsp;an&nbsp;RSS&nbsp;entry&nbsp;--</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*&nbsp;and&nbsp;it&nbsp;merges&nbsp;data&nbsp;into&nbsp;the&nbsp;stubs.</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*&nbsp;The&nbsp;method&nbsp;exhibited&nbsp;here&nbsp;is&nbsp;one&nbsp;of&nbsp;the&nbsp;more&nbsp;primitive&nbsp;ways&nbsp;of&nbsp;templating</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*&nbsp;information.&nbsp;See&nbsp;the&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;techniques.php&nbsp;techniques}</span><span class="src-doc">&nbsp;example&nbsp;for&nbsp;multiple</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*&nbsp;methods&nbsp;of&nbsp;looping.&nbsp;An&nbsp;even&nbsp;more&nbsp;advanced&nbsp;method&nbsp;would&nbsp;be&nbsp;to&nbsp;use&nbsp;the</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;QPTPL}</span><span class="src-doc">&nbsp;library.</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;Examples</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;M&nbsp;Butcher&nbsp;&lt;matt@aleph-null.tv&gt;</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@license</span><span class="src-doc">&nbsp;LGPL&nbsp;The&nbsp;GNU&nbsp;Lesser&nbsp;GPL&nbsp;(LGPL)&nbsp;or&nbsp;an&nbsp;MIT-like&nbsp;license.</span></div></li>
<li><div class="src-line"><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line"><span class="src-inc">require_once&nbsp;</span><span class="src-str">'../src/QueryPath/QueryPath.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;This&nbsp;is&nbsp;the&nbsp;stub&nbsp;RSS&nbsp;document.</span></div></li>
<li><div class="src-line"><span class="src-var">$rss_stub&nbsp;</span>=<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;?&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&lt;rss&nbsp;version=&quot;2.0&quot;&nbsp;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;xmlns:dc=&quot;http://purl.org/dc/elements/1.1/&quot;&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&lt;channel&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&nbsp;&lt;title&gt;&lt;/title&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&nbsp;&lt;link&gt;&lt;/link&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&nbsp;&lt;description&gt;&lt;/description&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&nbsp;&lt;language&gt;en&lt;/language&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&nbsp;&lt;generator&gt;QueryPath&lt;/generator&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&nbsp;&lt;/channel&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&lt;/rss&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;This&nbsp;is&nbsp;the&nbsp;stub&nbsp;RSS&nbsp;element.</span></div></li>
<li><div class="src-line"><span class="src-var">$rss_item_stub&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;?&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&lt;item&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&lt;title&gt;Untitled&lt;/title&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&lt;link&gt;&lt;/link&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&lt;description&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&lt;/description&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&lt;comments&gt;&lt;/comments&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&lt;category&gt;&lt;/category&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&lt;pubDate&gt;&lt;/pubDate&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&nbsp;&nbsp;&lt;guid&nbsp;isPermaLink=&quot;false&quot;&gt;&lt;/guid&gt;</span></div></li>
<li><div class="src-line"><span class="src-str">&lt;/item&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;Here&nbsp;are&nbsp;some&nbsp;dummy&nbsp;items.&nbsp;For&nbsp;the&nbsp;same&nbsp;of&nbsp;</span></div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;simplicity,&nbsp;we&nbsp;are&nbsp;just&nbsp;using&nbsp;a&nbsp;nested&nbsp;array.&nbsp;Of</span></div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;course,&nbsp;this&nbsp;could&nbsp;be&nbsp;a&nbsp;database&nbsp;lookup&nbsp;or&nbsp;whatever.</span></div></li>
<li><div class="src-line"><span class="src-var">$items&nbsp;</span>=&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'title'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Item&nbsp;1'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'link'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'http://example.com/item1'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'description'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'&lt;strong&gt;This&nbsp;has&nbsp;embedded&nbsp;&lt;em&gt;HTML&lt;/em&gt;&lt;/strong&gt;'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'comments'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'http://example.com/item1/comments'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'category'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Some&nbsp;Term'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'pubDate'&nbsp;</span>=&gt;&nbsp;<a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">'r'</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'guid'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'123456-789'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-key">array</span><span class="src-sym">(</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'title'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Item&nbsp;2'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'link'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'http://example.com/item2'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'description'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'&lt;strong&gt;This&nbsp;has&nbsp;embedded&nbsp;&lt;em&gt;HTML&lt;/em&gt;&lt;/strong&gt;'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'comments'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'http://example.com/item2/comments'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'category'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'Some&nbsp;Other&nbsp;Term'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'pubDate'&nbsp;</span>=&gt;&nbsp;<a href="http://www.php.net/date">date</a><span class="src-sym">(</span><span class="src-str">'r'</span><span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-str">'guid'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'123456-790'</span><span class="src-sym">,</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-sym">)</span><span class="src-sym">,</span></div></li>
<li><div class="src-line"><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;The&nbsp;main&nbsp;QueryPath,&nbsp;which&nbsp;holds&nbsp;the&nbsp;channel.</span></div></li>
<li><div class="src-line"><span class="src-var">$qp&nbsp;</span>=&nbsp;<a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-var">$rss_stub</span><span class="src-sym">,&nbsp;</span><span class="src-str">'title'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">text</span><span class="src-sym">(</span><span class="src-str">'A&nbsp;QueryPath&nbsp;RSS&nbsp;Feed'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="http://www.php.net/next">next</a><span class="src-sym">(</span><span class="src-str">'link'</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">text</span><span class="src-sym">(</span><span class="src-str">'http://example.com'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="http://www.php.net/next">next</a><span class="src-sym">(</span><span class="src-str">'description'</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">text</span><span class="src-sym">(</span><span class="src-str">'QueryPath:&nbsp;Find&nbsp;your&nbsp;way.'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">parent</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;For&nbsp;each&nbsp;element&nbsp;in&nbsp;the&nbsp;array&nbsp;above,&nbsp;we&nbsp;create&nbsp;a&nbsp;new&nbsp;</span></div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;QueryPath&nbsp;and&nbsp;then&nbsp;populate&nbsp;the&nbsp;XML&nbsp;fragment&nbsp;with&nbsp;data.</span></div></li>
<li><div class="src-line"><span class="src-key">foreach&nbsp;</span><span class="src-sym">(</span><span class="src-var">$items&nbsp;</span><span class="src-key">as&nbsp;</span><span class="src-var">$item</span><span class="src-sym">)&nbsp;</span><span class="src-sym">{</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-comm">//&nbsp;Begin&nbsp;with&nbsp;the&nbsp;stub&nbsp;RSS&nbsp;item,&nbsp;with&nbsp;title&nbsp;currently&nbsp;selected.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-var">$qpi&nbsp;</span>=&nbsp;<a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-var">$rss_item_stub</span><span class="src-sym">,&nbsp;</span><span class="src-str">'title'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Add&nbsp;a&nbsp;title.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">text</span><span class="src-sym">(</span><span class="src-var">$item</span><span class="src-sym">[</span><span class="src-str">'title'</span><span class="src-sym">]</span><span class="src-sym">)&nbsp;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Add&nbsp;a&nbsp;link.&nbsp;Note&nbsp;that&nbsp;we&nbsp;are&nbsp;giving&nbsp;no&nbsp;args&nbsp;to&nbsp;next()&nbsp;for&nbsp;the</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;sake&nbsp;of&nbsp;simplicity.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="http://www.php.net/next">next</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">text</span><span class="src-sym">(</span><span class="src-var">$item</span><span class="src-sym">[</span><span class="src-str">'link'</span><span class="src-sym">]</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Go&nbsp;to&nbsp;next&nbsp;element&nbsp;and&nbsp;add&nbsp;a&nbsp;description.&nbsp;Note&nbsp;that&nbsp;the&nbsp;text()</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;call&nbsp;will&nbsp;automatically&nbsp;encode&nbsp;HTML.&nbsp;&lt;&nbsp;will&nbsp;become&nbsp;&amp;lt;&nbsp;and&nbsp;so&nbsp;on.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="http://www.php.net/next">next</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">text</span><span class="src-sym">(</span><span class="src-var">$item</span><span class="src-sym">[</span><span class="src-str">'description'</span><span class="src-sym">]</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-comm">//&nbsp;Go&nbsp;on&nbsp;down&nbsp;the&nbsp;list...</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="http://www.php.net/next">next</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">text</span><span class="src-sym">(</span><span class="src-var">$item</span><span class="src-sym">[</span><span class="src-str">'comments'</span><span class="src-sym">]</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="http://www.php.net/next">next</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">text</span><span class="src-sym">(</span><span class="src-var">$item</span><span class="src-sym">[</span><span class="src-str">'category'</span><span class="src-sym">]</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="http://www.php.net/next">next</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">text</span><span class="src-sym">(</span><span class="src-var">$item</span><span class="src-sym">[</span><span class="src-str">'pubDate'</span><span class="src-sym">]</span><span class="src-sym">)</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="http://www.php.net/next">next</a><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">-&gt;</span><span class="src-id">text</span><span class="src-sym">(</span><span class="src-var">$item</span><span class="src-sym">[</span><span class="src-str">'guid'</span><span class="src-sym">]</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;&nbsp;&nbsp;</div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-comm">//&nbsp;Now&nbsp;we&nbsp;append&nbsp;it.</span></div></li>
<li><div class="src-line">&nbsp;&nbsp;<span class="src-var">$qp</span><span class="src-sym">-&gt;</span><span class="src-id">append</span><span class="src-sym">(</span><span class="src-var">$qpi</span><span class="src-sym">-&gt;</span><span class="src-id">top</span><span class="src-sym">(</span><span class="src-sym">))</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><span class="src-sym">}</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;If&nbsp;we&nbsp;were&nbsp;running&nbsp;this&nbsp;on&nbsp;a&nbsp;server,&nbsp;we&nbsp;would&nbsp;need&nbsp;to&nbsp;set&nbsp;the&nbsp;content</span></div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;type:</span></div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;header('Content-Type:&nbsp;application/rss+xml');</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;Write&nbsp;the&nbsp;outpt&nbsp;as&nbsp;XML.</span></div></li>
<li><div class="src-line"><span class="src-var">$qp</span><span class="src-sym">-&gt;</span><span class="src-id">writeXML</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><span class="src-php">?&gt;</span></div></li>
</ol>
</span></div>
        <div class="credit">
		    <hr class="separator" />
		    Documentation generated on Thu, 19 Mar 2009 18:01:18 -0500 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.2</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>